import xadmin
from .models import *
from xadmin import views

#全栈的配置 xadmin
class BaseSetting(object):
    enable_themes = True   #主题功能  打开
    use_bootswatch = True

class GlobalSettings(object):
    site_title = "后台管理系统"   #将网页左上角的 django xadmin 替换
    site_footer = "在线教育平台"   #更改   底部 @我的公司
    menu_style = "accordion"  #列表折叠



class EmailVerifyRecordAdmin(object):
    list_display = ['code','email','send_type','send_time']
    search_fields = ['code','email','send_type']  #搜索框
    list_filter = ['code','email','send_type','send_time']  #过滤器


class BannerAdmin(object):
    list_display = ['title','image','url','index','add_time']
    search_fields = ['title','image','url','index']
    list_filter = ['title','image','url','index','add_time']




xadmin.site.register(EmailVerifyRecord,EmailVerifyRecordAdmin)
xadmin.site.register(Banner,BannerAdmin)
xadmin.site.register(views.BaseAdminView,BaseSetting)
xadmin.site.register(views.CommAdminView,GlobalSettings)
